package com.lqq.spring.controller;


import com.lqq.framework.context.ApplicationContext;
import com.lqq.framework.context.support.ClassPathXmlApplicationContext;
import com.lqq.spring.service.UserService;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.support.ClassPathXmlApplicationContext;

//控制层
public class UserController {
    public static void main(String[] args) throws Exception{
        //1.创建Spring的容器对象
        ApplicationContext applicationContext =  new ClassPathXmlApplicationContext("applicationContext.xml");
        //2.从容器对象中获取UserService对象
        UserService userService = applicationContext.getBean("UserService", UserService.class);
        //3.调用UserService方法进行业务处理
        userService.add();
    }
}
